<template>
  <div class="school">
      <h2>
          <h2>学校名称:{{name}}</h2>
          <h2>学校地址:{{address}}</h2>
          <button @click="schoolName">点击传入数据</button>
      </h2>
  </div>
</template>

<script>
export default {
        data(){
            return{
                name:'尚硅谷',
                address:'鸿福科技园'
            }
        },
        // 需要传参的地方进行事件的调用$emit
      methods:{
          schoolName(){
              this.$bus.$emit('haha',this.name)
          
      }
}
}
</script>

<style>
    .school{
        background-color: turquoise;
        padding:30px;
    }
</style>